#include "interrupt.h"
#include "tastatur.h"
#include "pit.h"

// IDT-Eintrag Struktur
struct idt_entry_struct
{
	unsigned short baseLo;
	unsigned short selector;
	unsigned char immerNull;
	unsigned char flags;
	unsigned short baseHi;

} __attribute__((packed));
typedef struct idt_entry_struct idt_entry_t;

// IDT Pointer -> LIDT
struct idt_ptr_struct
{
	unsigned short limit;
	unsigned long base;
} __attribute__((packed));
typedef struct idt_ptr_struct idt_ptr_t;

// CPU-Status speichern
struct cpu_state
{
	unsigned long eax; 
	unsigned long ebx;
	unsigned long ecx;
	unsigned long edx;
	unsigned long esi;
	unsigned long edi;
	unsigned long ebp;
	unsigned long intr;
	unsigned long error;
	unsigned long eip;
	unsigned long cs;
	unsigned long eflags;
	unsigned long esp;
	unsigned long ss;
};

extern void intr_stub_0();
extern void intr_stub_1();
// Weiter Interrupt Service Routinen
extern void irq_0();  // 32
extern void irq_1();
extern void irq_2();

extern void idt_flush(unsigned long);

void install_idt_table(void);
void add_idt_table(unsigned char, unsigned long,
		   unsigned short, unsigned char);
